package com.hsogoo.avatar.registry;

import com.google.common.collect.Maps;
import com.hsogoo.avatar.model.InvokeMethod;

import java.lang.reflect.Method;
import java.util.Map;

/**
 * @Author huangsaigang
 * Created @2018/9/30.
 */
public class InvokeMethodRegistry {

    private static Map<Method, InvokeMethod> invokeRegistries = Maps.newConcurrentMap();

    public static void register(Method method, InvokeMethod invokeMethod){
        invokeRegistries.put(method, invokeMethod);
    }

    public static InvokeMethod getInvokeMethod(Method key){
        if(invokeRegistries.containsKey(key)){
            return invokeRegistries.get(key);
        }
        return null;
    }
}
